#include <stdio.h>

typedef enum _enum
{
	aa,
	ab,
	ac,
	ad,
	ae,
	af,
	ag,
}em;

int main()
{
  /*40064c:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400650:	910003fd 	mov	x29, sp
  400654:	b9001fbf 	str	wzr, [x29, #28]*/
	em a = 0;

  /*400658:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  40065c:	91208000 	add	x0, x0, #0x820
  400660:	b9401fa1 	ldr	w1, [x29, #28]
  400664:	97ffffb7 	bl	400540 <printf@plt>*/
	  printf("%d\n", a);

  /*400668:	528000a0 	mov	w0, #0x5                   	// #5
  40066c:	b9001fa0 	str	w0, [x29, #28]*/
	a = af;

  /*400670:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  400674:	91208000 	add	x0, x0, #0x820
  400678:	b9401fa1 	ldr	w1, [x29, #28]
  40067c:	97ffffb1 	bl	400540 <printf@plt> */
	printf("%d\n", a);

  /*400680:	b9001bbf 	str	wzr, [x29, #24]*/
	int b = 0;

  /*400684:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  400688:	91208000 	add	x0, x0, #0x820
  40068c:	b9401ba1 	ldr	w1, [x29, #24]
  400690:	97ffffac 	bl	400540 <printf@plt>*/
	printf("%d\n", b);

  /*400694:	52800080 	mov	w0, #0x4                   	// #4
  400698:	b90017a0 	str	w0, [x29, #20]*/
	int e = 4;

  /*40069c:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4006a0:	9120a000 	add	x0, x0, #0x828
  4006a4:	b94017a1 	ldr	w1, [x29, #20]
  4006a8:	97ffffa6 	bl	400540 <printf@plt>*/
	printf("%d\n", e);

  /*4006ac:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4006b0:	9120c000 	add	x0, x0, #0x830
  4006b4:	d2800041 	mov	x1, #0x2                   	// #2
  4006b8:	97ffffa2 	bl	400540 <printf@plt>*/
	printf("%d\n", 2);

  /*4006bc:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4006c0:	91212000 	add	x0, x0, #0x848
  4006c4:	d2800081 	mov	x1, #0x4                   	// #4
  4006c8:	97ffff9e 	bl	400540 <printf@plt>*/
	printf("%d\n", 4);

  /*4006cc:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4006d0:	91218000 	add	x0, x0, #0x860
  4006d4:	d2800081 	mov	x1, #0x4                   	// #4
  4006d8:	97ffff9a 	bl	400540 <printf@plt>*/
	printf("%d\n", 4);

  /*4006dc:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4006e0:	9121e000 	add	x0, x0, #0x878
  4006e4:	d2800001 	mov	x1, #0x0                   	// #0
  4006e8:	97ffff96 	bl	400540 <printf@plt>*/
	printf("%d\n", 0);

  /*4006ec:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  4006f0:	9121e000 	add	x0, x0, #0x878
  4006f4:	d2800001 	mov	x1, #0x0                   	// #0
  4006f8:	97ffff92 	bl	400540 <printf@plt>*/
	printf("%d\n", 0);

  /*4006fc:	b9401fa0 	ldr	w0, [x29, #28] */
	switch (a) {

  /*400700:	7100081f 	cmp	w0, #0x2 
  400704:	54000220 	b.eq	400748 <main+0xfc>*/  // b.none		Z = 1	 相等
	case aa:
		break;

  /*400708:	7100081f 	cmp	w0, #0x2
  40070c:	540000a8 	b.hi	400720 <main+0xd4>*/  // b.pmore	C=1,Z=0	 无符号数大于
	case ab:
		break;
	
  /*400710:	7100001f 	cmp	w0, #0x0
  400714:	540001e0 	b.eq	400750 <main+0x104>*/  // b.none		Z = 1	 相等
	case ac:
		break;

  /*400718:	7100041f 	cmp	w0, #0x1
  40071c:	14000012 	b	400764 <main+0x118>*/
	case ad:
		break;

  /*400720:	7100101f 	cmp	w0, #0x4
  400724:	540001a0 	b.eq	400758 <main+0x10c>  // b.none	Z = 1	 相等
  400728:	7100101f 	cmp	w0, #0x4
  40072c:	540001a3 	b.cc	400760 <main+0x114>*/  // b.lo, b.ul, b.last	C = 0	 无符号数小于
	case ae:
		break;

  /*400730:	7100141f 	cmp	w0, #0x5
  400734:	54000181 	b.ne	400764 <main+0x118>*/  // b.any	Z = 0	 不相等
	case af:
		
  /*400738:	90000000 	adrp	x0, 400000 <_init-0x4c0>
  40073c:	91224000 	add	x0, x0, #0x890
  400740:	97ffff7c 	bl	400530 <puts@plt>
  400744:	14000008 	b	400764 <main+0x118>*/
		puts("aaaaaaaaa\n");
		break;
	}

  /*400748:	d503201f 	nop
  40074c:	14000006 	b	400764 <main+0x118>
  400750:	d503201f 	nop
  400754:	14000004 	b	400764 <main+0x118>
  400758:	d503201f 	nop
  40075c:	14000002 	b	400764 <main+0x118>
  400760:	d503201f 	nop
  400764:	52800000 	mov	w0, #0x0                   	// #0
  400768:	a8c27bfd 	ldp	x29, x30, [sp], #32
  40076c:	d65f03c0 	ret*/
	return 0;
}

#if 0

编译时会报ra-enum.c:87:2: 警告： switch 没有处理枚举值‘ag’ [-Wswitch]， 特意留着的，以判别是enum。

#endif
